package Test;

public class CircleTest {
	
	

	public static void main(String[] args) {
		
		Circle circle = new Circle(5.6);
		
		double findArea = circle.findArea();
		
		System.out.println("编号：" + Circle.getNum() + "，数量：" + Circle.getTotal() + "，面积：" + findArea);
		
		Circle circle1 = new Circle(5.6);
		
		double findArea1 = circle1.findArea();
		
		System.out.println("编号：" + Circle.getNum() + "，数量：" + Circle.getTotal() + "，面积：" + findArea1);
	}

}

class Circle{
	
	private double radius;
	//加static修饰  变成静态变量不会随着对象消失而消失  表现结果 不加 编号一直显示1不会叠加
	private static int num = 0; 
	private static int total = 0;
	
	
	
	public Circle() {
		total++;
		num++;
	}
	


	public Circle(double radius) {
		total++;
		num++;
		this.radius = radius;
	}

	

	public double getRadius() {
		return radius;
	}



	public void setRadius(double radius) {
		this.radius = radius;
	}



	public static int getNum() {
		return num;
	}



	public static void setNum(int num) {
		Circle.num = num;
	}



	public static int getTotal() {
		return total;
	}



	public static void setTotal(int total) {
		Circle.total = total;
	}



	public double findArea(){
		
		return Math.PI * radius*radius;
		
	}
	
	
}